﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using MVCDemo.Models;

namespace MVCDemo.Data
{
    public class DataInitlizer:DropCreateDatabaseIfModelChanges<MVCDemoDb>
    {
        protected override void Seed(MVCDemoDb db)
        {
            db.Users.AddRange(new List<User>
            {
                new User
                {
                    Username="胖胖不吃肉丸",
                    Password="123456",
                },
                new User
                {
                    Username="黄炎榕🐖",
                    Password="123",
                },
                new User
                {
                    Username="哈哈",
                    Password="123",
                },
                new User
                {
                    Username="噗噗",
                    Password="123",
                }
            }) ;
            db.Messages.AddRange(new List<Message>
            {
                new Message
                {
                    FormUserId=1,
                    Content="爱的魔力转圈圈",
                },
                new Message
                {
                    FormUserId=4,
                    Content="一giao我里giaogiao"
                },
                new Message
                {
                    FormUserId=2,
                    Content="我滴宝，我什么都能抗，就是扛不住想你呀",
                }
            }) ;
            db.Comments.AddRange(new List<Comment>
            {
                new Comment
                {
                    FormUserId=2,
                    MsgId=1,
                    Comments="我滴宝"
                },
                new Comment
                {
                    FormUserId=3,
                    MsgId=4,
                    Comments="冲冲冲"
                },
                new Comment
                {
                    FormUserId=1,
                    MsgId=2,
                    Comments="工友说我太能扛了"
                },
            });
            db.SaveChanges();
            base.Seed(db);
        }
    }
}